<section id="container" class="">
  <!--main content start-->
  <section id="main-content">
    <section class="wrapper">
      <!--state overview end-->
      <div class="row">
        <div class="col-lg-12">
          <section class="panel">
            <header class="panel-heading">
              添加系统公告
            </header>
            <div class="panel-body">
              <form>
                <div class="form-group customerForm">
                  <label class="col-sm-2 control-label">所属公司*</label>
                  <div class="col-sm-10">
                      <select class="form-control" id="company">
                          <option value="" selected>请选择</option>
                          <option ng-repeat="x in comp" value="{{x.companyId}}">{{x.company}}</option>
                      </select>
                  </div>
                </div>
                <div class="form-group customerForm">
                  <label class="col-sm-2 control-label">内容*</label>
                  <div class="col-sm-10">
                    <textarea class="form-control" id="content" name="content" maxlength="500"></textarea>
                  </div>
                </div>
                
              </form>
            </div>
          </section>
          <section class="panel">
            <div class="panel-body">
                <p class="default-buttons">
                    <a href="javascript:void(0);" class="button-back btn btn-info" onclick="window.history.back()">返回</a>
                    <a href="javascript:void(0);" class="button-next  btn btn-success vsubmit">确认提交</a>
                  </p>
            </div>
          </section>
        </div>
      </div>
    </section>
  </section>
  <!--main content end-->
</section>
<script>
    function addSysmg(CertusFormAjax,$scope) {
        CertusFormAjax.ajax('companyList',{},function (response) {
            $scope.comp = JSON.parse(response.data);
        });
        $(".vsubmit").on('click',function () {
            var company = $("#company").val();
            if (company==""){
                layer.msg("所属公司不能为空");
                return;
            }
            var content = $("#content").val();
            if (content==""){
                layer.msg("内容不能为空");
                return;
            }
            CertusFormAjax.ajax('addSysmg',{"compCode":company,"content":content},function () {
                layer.msg("添加成功");
                window.history.back()
            });
        });
    }
</script>